package com.zb_study.Homework04;

public class Scientist extends Person {
    private double yearSal;

    public Scientist(String name, double monthSal, double yearSal) {
        super(name, monthSal);
        this.yearSal = yearSal;
    }

    public double getYearSal() {
        return yearSal;
    }

    public void setYearSal(double yearSal) {
        this.yearSal = yearSal;
    }

    @Override
    public void printSal() {
        System.out.print("科学家  ");
        System.out.println(getName() + "全年工资为：" +(12 * getMonthSal() + yearSal));
    }
}
